
<template>
  <section class="carTypeConfig">
    <el-dialog
      v-dialogDrag
      title="来源单号"
      :visible.sync="curPopupsVisible"
      width="1000px"
      center
      @close="sendCode"
      :close-on-click-modal="false"
      :append-to-body="true"
    >
      <dialogHeader slot="title" :title="'来源单号'" :styleType="$store.state.app.dialogType"></dialogHeader>
      <one-table-template
        ref="multipleTable"
        :dynamicButtons="tableButtons"
        :dynamicComponents="tableComponents"
        :dynamicApiConfig="apiConfig"
        :dynamicTableCols="tableCols"
        :dynamicFormFields="formField"
        :dynamicIsShowSelect="isMul"
      />
    </el-dialog>
  </section>
</template>
<script>
import { oneTableWithViewTemplateMixins } from "@/components/mixins/oneTableWithViewTemplateMixins";
import { valueObjectMixins } from "@/components/mixins/valueObjectMixins";
import { crmApis } from "@/api/apiList/crm";
import OneTableTemplate from "@/components/templates/popupsOneTable";
export default {
  // 组件混入对象：{data[listQuery] methods[queryTable]}
  mixins: [oneTableWithViewTemplateMixins, valueObjectMixins],
  components: {
    OneTableTemplate,
    dialogHeader: () => import("@/components/dialogHeader") //弹窗标题
  },
  data() {
    return {
      // 网格查询API配置对象
      apiConfig: crmApis.csGetServerInfoListQuery,
      // 动态组件-按钮
      tableButtons: [
        {
          compKey: "btnKey1",
          type: "primary",
          size: "small",
          clickEvent: () => this.queryTable(1),
          text: "查询"
        },
        {
          compKey: "btnKey2",
          type: "",
          size: "small",
          clickEvent: () => this.sendCode(this.codeField, "serverOrder"),
          // clickEvent: () => this.sendCode(),
          text: "确认"
        },
        {
          compKey: "btnKey3",
          type: "",
          size: "small",
          clickEvent: () => this.reset(),
          text: "重置"
        }
      ],
      // 动态组件-查询条件
      tableComponents: [
        // 显示组件

        {
          compKey: "compKey1",
          labelName: "服务类型",
          codeField: "serverType",
          lookuptype: "LX009",
          component: () => import("@/components/crm/lookupValue/lookupvalue"),
          type: "dropdownList",
          isMust: true,
          isMul: false
        },
        {
          compKey: "cantactWayId",
          labelName: "服务单号",
          codeField: "serverOrder",
          isRequire: false,
          isMust: true,
          isMul: false,
          component: () => import("@/components/crm/textbox/crmTextInput")
        },
        {
          compKey: "compKey3",
          labelName: "建单日期",
          codeField: "beginCreatedDate,endCreatedDate",
          component: () => import("@/components/crm/Time/crmdtDatePicker"),
          type: "inputText",
          isMust: true
        },
        {
          compKey: "compKey3",
          labelName: "客户名称",
          codeField: "custName",
          component: () => import("@/components/crm/textbox/crmTextInput"),
          type: "inputText",
          isMust: true
        },
        {
          compKey: "compKey3",
          labelName: "电话",
          codeField: "phone",
          component: () => import("@/components/crm/textbox/crmTextInput"),
          type: "inputText",
          isMust: true
        }
      ],
      // 动态生成网格列
      tableCols: [
        {
          prop: "serverOrder",
          label: "服务单号",
          width: null,
          align: "center"
        },
        {
          prop: "serverTypeName",
          label: "服务类型",
          width: null,
          align: "center"
        },
        {
          prop: "custName",
          label: "客户名称",
          width: null,
          align: "center"
        },
        {
          prop: "contactTel",
          label: "电话",
          width: null,
          align: "center"
          // hidden: true
        },
        {
          prop: "createdDate",
          label: "建单日期",
          width: null,
          align: "center"
          // hidden: true
        }
      ],
      //表单查询数据（查询条件）
      formField: {
        serverType: "",
        serverOrder: "",
        beginCreatedDate: "",
        endCreatedDate: "",
        custName: "",
        phone: "",
        oemCode: "1",
        groupCode: "1"
      },
      handleTableRowData: {
        value: this.codeField,
        text: "serverOrder"
      }
    };
  },
  mounted() {
    // this.formField.isEnable="1"
  },
  methods: {}
};
</script>
